/****** Object:  Stored Procedure [dbo].spproductUpdate Script Date: 11/24/2012 ******/
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[spproductUpdate]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
	DROP PROCEDURE [dbo].[spproductUpdate]
GO

/******************************************************************************
**		Name: [dbo].spproductUpdate
**		Desc:
**
**		Return values:
**
**		Called by:
**
**		Parameters:
**		Input						Output
**		----------					----------
**
**		Auth: MinhSong
**		Date: 11/24/2012
*******************************************************************************
**		Change History
*******************************************************************************
**		Date:		Author:					Description:
**		--------	--------				-----------------------------------
**
*******************************************************************************/

CREATE PROCEDURE [dbo].[spproductUpdate]
(
	@ProductID int,
	@ProductName nvarchar(50),
	@ProductImage nvarchar(100),
	@ProductDesc text,
	@Weight int,
	@Height int,
	@Long int,
	@Wide int,
	@UpdateBy nchar(50),
	@Price real,
	@Stock int,
	@Unit nvarchar(50)
)

WITH ENCRYPTION

AS

SET NOCOUNT ON

UPDATE [tbl_product]
SET [ProductName] = @ProductName,
	[ProductImage] = @ProductImage,
	[ProductDesc] = @ProductDesc,
	[Weight] = @Weight,
	[Height] = @Height,
	[Long] = @Long,
	[Wide] = @Wide,
	[UpdateBy] = @UpdateBy,
	[UpdateDate] = getdate(),
	[Price] = @Price,
	[Stock] = @Stock,
	[Unit] = @Unit
WHERE	[ProductID] = @ProductID
GO

--GRANT EXECUTE ON [dbo].[spproductUpdate] TO [sa]
--GO
